
/*==============================================================*/
/* Table: {organ.code}_INFO_ART2COL                                     */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_ART2COL (
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   ARTICLE_LOGIC_ID     bigint                  NOT NULL,
   COLUMN_LOGIC_ID      bigint                  NOT NULL,
   ARTICLE_ORDER        INT                  NULL,
   CONSTRAINT PK_{organ.code}_INFO_ART2COL PRIMARY KEY NONCLUSTERED (ORGAN_LOGIC_ID, ARTICLE_LOGIC_ID, COLUMN_LOGIC_ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_INFO_ARTICLE                                     */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_ARTICLE (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   ARTICLE_TITLE        VARCHAR(200)         NOT NULL,
   ARTICLE_IMG          VARCHAR(100)         NULL,
   ARTICLE_SUBHEAD      VARCHAR(200)         NULL,
   ARTICLE_SUMMARY      VARCHAR(500)         NULL,
   ARTICLE_KEY          VARCHAR(200)         NULL,
   ARTICLE_ORDER        INT                  NULL,
   IS_PUB               CHAR(1)              NULL DEFAULT '0',
   ARTICLE_STATUS       CHAR(1)              NULL DEFAULT '0',
   ARTICLE_QORIGINAL    VARCHAR(200)         NULL,
   PAGE_VIEWS           bigint                  NULL,
   PAGE_GOODS           bigint                  NULL,
   ARTICLE_WRITER       VARCHAR(200)         NULL,
   USER_ID              bigint                  NULL,
   USER_NAME            VARCHAR(50)          NULL,
   ORG_ID               bigint                  NULL,
   ORG_NAME             VARCHAR(200)         NULL,
   IS_TOPLINE           CHAR(1)              NULL DEFAULT '0',
   IS_STICK             CHAR(1)              NULL DEFAULT '0',
   IS_COMMENT           CHAR(1)              NULL DEFAULT '0',
   SEND_TIME            DATETIME             NULL,
   END_TIME             DATETIME             NULL,
   PUB_TIME             DATETIME             NULL,
   SYNC_MINI_SITE       CHAR(1)              NULL DEFAULT '0',
   SYNC_APP             CHAR(1)              NULL DEFAULT '0',
   COLUMN_LOGIC_ID      bigint                  NULL,
   COLUMN_NAME          VARCHAR(100)         NULL,
   CREATE_PERSON        VARCHAR(50)          NULL,
   CREATE_PERSON_ID     bigint                  NULL,
   CREATE_TIME          DATETIME             NULL,
   UPDATE_PERSON        VARCHAR(50)          NULL,
   UPDATE_TIME          DATETIME             NULL,
   CONSTRAINT PK_{organ.code}_INFO_ARTICLE PRIMARY KEY NONCLUSTERED (ID)
)
go


/*==============================================================*/
/* Table: {organ.code}_INFO_ARTICLE_EXT                                 */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_ARTICLE_EXT (
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   ARTICLE_LOGIC_ID     bigint                  NOT NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   EXT6                 VARCHAR(50)          NULL,
   EXT7                 VARCHAR(50)          NULL,
   EXT8                 VARCHAR(50)          NULL,
   EXT9                 VARCHAR(50)          NULL,
   EXT10                VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_INFO_ARTICLE_EXT PRIMARY KEY NONCLUSTERED (ORGAN_LOGIC_ID, ARTICLE_LOGIC_ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_INFO_ARTICLE_INFO                                */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_ARTICLE_INFO (
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   ARTICLE_LOGIC_ID     bigint                  NOT NULL,
   CONTENT              TEXT                 NULL,
   CONTENT_TXT          TEXT                 NULL,
   CONSTRAINT PK_{organ.code}_INFO_ARTICLE_INFO PRIMARY KEY NONCLUSTERED (ORGAN_LOGIC_ID, ARTICLE_LOGIC_ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_INFO_ARTICLE_LOG                                 */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_ARTICLE_LOG (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   ARTICLE_ID           bigint                  NOT NULL,
   OPERATOR_STEP        VARCHAR(50)          NULL,
   OPERATOR_ID          VARCHAR(50)          NULL,
   OPERATOR_NAME        VARCHAR(50)          NULL,
   OPERATOR_TIME        DATETIME             NULL,
   OPERATOR_CONTENT     VARCHAR(1000)        NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_INFO_ARTICLE_LOG PRIMARY KEY NONCLUSTERED (ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_INFO_ART_COMMENT                                 */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_ART_COMMENT (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   PID                  bigint                  NOT NULL,
   ARTICLE_LOGIC_ID     bigint                  NOT NULL,
   USER_NAME            VARCHAR(50)          NULL,
   USER_LOGIC_ID        bigint                  NULL,
   CONTENT              VARCHAR(500)         NULL,
   CONTENT_TIME         DATETIME             NULL,
   IS_ANONYMOUS         CHAR(1)              NULL DEFAULT '0',
   SIGNATURE            VARCHAR(50)          NULL,
   IS_APPROVE           CHAR(1)              NULL DEFAULT '0',
   APPROVE_PERSON       VARCHAR(50)          NULL,
   APPROVE_TIME         DATETIME             NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_INFO_ART_COMMENT PRIMARY KEY NONCLUSTERED (ID, LOGIC_ID)
)
go


/*==============================================================*/
/* Table: {organ.code}_INFO_ART_VIEW                                    */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_ART_VIEW (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   ARTICLE_LOGIC_ID     bigint                  NOT NULL,
   VIEW_FROM            VARCHAR(50)          NULL,
   VIEW_TIME            DATETIME             NULL,
   VIEW_VISITOR         VARCHAR(50)          NULL,
   VIEW_IP              VARCHAR(50)          NULL,
   VIEW_MAC             VARCHAR(50)          NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_INFO_ART_VIEW PRIMARY KEY NONCLUSTERED (ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_INFO_COLUMN                                      */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_COLUMN (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   COLUMN_PID           bigint                  NOT NULL,
   COLUMN_ROOTID        bigint                  NOT NULL,
   COLUMN_ID_PATH       VARCHAR(200)         NULL,
   COLUMN_NAME          VARCHAR(100)         NULL,
   COLUMN_IMG           VARCHAR(100)         NULL,
   COLUMN_ORDER         INT                  NULL,
   ART_TEMPLATE         VARCHAR(50)          NULL,
   SYNC_MINI_SITE       CHAR(1)              NULL DEFAULT '0',
   SYNC_APP             CHAR(1)              NULL DEFAULT '0',
   COMMENT_RULE         CHAR(1)              NULL DEFAULT '0',
   APPROVE_RULE         CHAR(1)              NULL DEFAULT '0',
   COLUMN_RULE          CHAR(1)              NULL DEFAULT '0',
   COLUMN_MEMO          VARCHAR(500)         NULL,
   UPDATE_PERSON        VARCHAR(50)          NULL,
   UPDATE_TIME          DATETIME             NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_INFO_COLUMN PRIMARY KEY NONCLUSTERED (ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_INFO_COL_POWER                                   */
/*==============================================================*/
CREATE TABLE {organ.code}_INFO_COL_POWER (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   COLUMN_LOGIC_ID      bigint                  NOT NULL,
   OBJ_TYPE             VARCHAR(50)          NOT NULL,
   OBJ_ID               bigint                  NOT NULL,
   OBJ_NAME             VARCHAR(100)         NULL,
   UPDATE_PERSON        VARCHAR(50)          NULL,
   UPDATE_TIME          DATETIME             NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_INFO_COL_POWER PRIMARY KEY NONCLUSTERED (ID)
)
go
